package com.back.network.web.Utils;

import java.util.Random;

public class StringUtils {

	/**
	 * 生成小写字母及数字的随机字符串
	 * @param length 指定位数
	 */
	public static String getRandomString(int length) {
		String str = "abcdefghijklmnopqrstuvwxyz0123456789";
		Random random = new Random();
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < length; i++) {
			int number = random.nextInt(36);
			sb.append(str.charAt(number));
		}
		return sb.toString();
	}
}
